package 案例.生产消费;

/**
 * 服务员
 *
 * @author kangjx
 * @version 1.0
 * @date 2023/7/6 下午8:25
 */
public class Waitter implements Runnable {

    private final Food food;

    public Waitter(Food food) {
        this.food = food;
    }

    /**
     * 线程主体方法 ，就绪状态要执行的方法
     */
    public void run() {
        for (int i = 0, len = 20; i < len; i++) {
            this.food.consumerFood();
        }
    }

}
